package com.dkm.ec.user.repository.impl;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.user.domain.UserRechargeRecord;
import com.dkm.ec.user.persistence.dao.UserRechargeRecordQueryDao;
import com.dkm.ec.user.persistence.entity.UserRechargeRecordPo;
import com.dkm.ec.user.repository.UserRechargeRecordRepository;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * Created by fanjinyuan on 2017/8/19.
 */
@Repository
public class UserRechargeRecordRepositoryImpl  extends AbstractRepository<String, UserRechargeRecordPo, UserRechargeRecord> implements UserRechargeRecordRepository {

    @Resource
    private UserRechargeRecordQueryDao userRechargeRecordQueryDao;

    @Override
    public UserRechargeRecord newInstance() {
        UserRechargeRecordPo po = new UserRechargeRecordPo();
        UserRechargeRecord domain = SpringHelper.getBean(UserRechargeRecord.class);
        domain.setData(po);
        return domain;
    }

    @Override
    public UserRechargeRecord newInstance(UserRechargeRecordPo po) {
        UserRechargeRecord domain = SpringHelper.getBean(UserRechargeRecord.class);
        domain.setData(po);
        return domain;
    }

    @Override
    protected IQueryDao<String, UserRechargeRecordPo> getQueryDao() {
        return userRechargeRecordQueryDao;
    }
}
